home *** CD-ROM | disk | FTP | other *** search
/ Gigantic Games 2 / Gigantic Games 2.iso / pc / _m_ / minesweeper / readme < prev    next >
Text File  |  1994-12-23  |  8KB  |  190 lines

  1. Short: Minesweeper-clone, incl. C++-source
  2. ---------------------------------------------------------------------------
  3.  
  4.                         AMIGA Minesweeper V0.98
  5.                        ~~~~~~~~~~~~~~~~~~~~~~~~~
  6.  
  7. What's it?
  8. ~~~~~~~~~~
  9.   This is the 3rd game whick imitates MS-Window's "Minesweeper" which
  10.   is based on X's "XMines" (or vice versa?). The two others appeared on
  11.   Fish disk #541 (MineClearer, by Kopetzky Theodorich) and #707 (AMines,
  12.   by Manfred Huesmann). 
  13.  
  14.  
  15. Features:
  16. ~~~~~~~~~
  17.   - OS2.0 only! ("It's a feature, not a bug!")
  18.   - Adjusts to font-size (Developped using Thin611/11)
  19.   - Adjusts to Non-/Interlace
  20.   - No GAME-OVER on first try
  21.   - MS-Windows-like look&feel
  22.   - C++-Source included!
  23.  
  24.  
  25. How to play
  26. ~~~~~~~~~~~
  27.   The aim is to detect all mines in a minefield. Selecting a field (by
  28.   pressing the left mouse-button) shows the number of mines in the
  29.   surrounding 8 fields. Or it terminates the game, if you "step" on a
  30.   mine! The game's won when all mines are marked with an 'X' (right
  31.   mouse-button) and all other fields are selected. The gadget in the
  32.   upper-left corner tells you, how many mines are left to be marked,
  33.   but be careful! It doesn't tell you whether you really marked some
  34.   mines or just empty fields! Besides that, you can mark more fields
  35.   than there are mines, thus, getting the counter below zero.
  36.  
  37.   To give it all a certain thrill, there's a watch in the upper right
  38.   corner, displaying how many seconds wou're already playing. The faster
  39.   you are, the better! My high-score for the standard-8x8-board is 8
  40.   seconds. 
  41.  
  42.  
  43. Installation
  44. ~~~~~~~~~~~~
  45.   AMIGA Minesweeper relies on Markus Wilds ixemul.library, which is
  46.   provided in the libs-Directory, please watch the COPYING-file. To 
  47.   install, copy the lib into your libs:-directory or add a multi-assign
  48.   on "libs" to "libs:". And that's all there is. Happy sweeping!
  49.  
  50.  
  51. Invoking
  52. ~~~~~~~~
  53.   At present time, the game may only be launched from CLI/shell.
  54.   Synopsis:
  55.  
  56.       mine [x-dimension y-dimension [percentage]]
  57.  
  58.   The arguments are all integers. If none are given, a 8x8-board is given
  59.   which contains 15% mines. The window's always centered on the screen.
  60.   The maximum x/y-dimension depend on your font and screenmode! By the
  61.   way, the default-values are the same as for MS-Window's Minesweeper at
  62.   "Beginner-Level". Here's the full table of Minesweeper's settings:
  63.  
  64.                         | x-dim    | y-dim   |  %
  65.      -------------------+----------+---------+----
  66.       Beginner          |   8      |   8     | 15
  67.       Intermediate      |  16      |  16     | 15
  68.       Expert            |  30      |  16     | 20
  69.  
  70.   Yes, this should be put into a menu! I'll do it 'till the next release...
  71.  
  72.   After you finish one game (either by winning or loosing), the "GO!"-
  73.   button in the upper-middle becomes active and you can get another try
  74.   by pressing it. Two remarks here:
  75.   - The timer starts when you set your first mark or select the first
  76.     field, not when you press the "GO!"-Button.
  77.   - If you hit a mine on the very-first try, the mine will be moved some-
  78.     where else and you won't be telled. MineClearer didn't have this
  79.     feature and I can't remember whether AMines had it!
  80.  
  81.  
  82. Technical details:
  83. ~~~~~~~~~~~~~~~~~~
  84.   Well, the program's written using Markus Wild's port of the GNU-C++-
  85.   Compiler. Why C++, you ask? Well, why not?! First I have to say that
  86.   this is my 1st prog which deals with gadgets and I'm currently reading
  87.   (the awful translation of) Bjarne Stroustrup's book "The C++ programming
  88.   language".
  89.  
  90.   Initially, I wanted to keep the "minefield" as a 2-dimensional array
  91.   on some structure, but I didn't like that too much. So, to learn not
  92.   only programming the Amiga but to do also some basic things in C++, I
  93.   decided it to be an array of pointers to objects. Each object repre-
  94.   sents one field in the minefield, therefore the object-type is called
  95.   "Field". Each Field-object mainly contains:
  96.    - a pointer to it's gadget (representing the object on the screen).
  97.    - a short txt-array, which contains the label of the [fF]ield
  98.  
  99.   Besides that, I put the pointer to the object {this} into the gadget's
  100.   "UserData"-field {field.cc: _gad->UserData = (APTR)this}. Thus, when
  101.   Intuition signals me an IDCMP_GADGETUP, I've just to read the UserData-
  102.   field to get a reference to the entire object without having to seach
  103.   the whole minefield-array to get the reference. That's a real Callback!
  104.                                                                 ~~~~~~~~~
  105.   After getting the selected field/object, I just give it the command to
  106.   check itself {f->check()}. The Field-object changes the gadget to a
  107.   SELECTED-state (using the Field::open()-function) and checks for any
  108.   mines. If there are none in any of the surrounding fields, it check()s
  109.   each one of then in a nested way (Rekursion, auf gut Deutsch!).
  110.  
  111.   However, the callback doesn't work with the right mousebutton. For this
  112.   reason, I get the object's position in the minefield[][] from the mouse-
  113.   coordinates. After that, it's an easy thing marking the field, using the
  114.   Field::mark()-member-function.
  115.  
  116.   There's one general problem when doing Amiga-programming with C++. After
  117.   the definition, the keyword "struct" is redundant, i. e. you can write
  118.  
  119.       struct ab { int a,b; };        // Define struct
  120.       ab x;                          // struct ab x;
  121.  
  122.   This crashes in many system-structs, mainly in Intuition. It starts with
  123.   IntuitionBase: that's a type-name, but it's also the name of a variable,
  124.   the base-adress of the Intuition-library! (It's no matter that the
  125.   variable is a pointer!). Other examples are "struct View *View" in the
  126.   Viewextra-struct from <graphics/view.h> and GfxBase.
  127.  
  128.   How to deal with this problem? The variable's name is used in amiga.lib
  129.   (libamiga.a), so the only way is to rename the type. Here's a way how to
  130.   do it (inspired by M. Wild's TrueMultiAssign):
  131.  
  132.       #define IntuitionBase IntuiBase
  133.       # include <intuition/intuitionbase.h>
  134.       #undef IntuitionBase
  135.  
  136.       IntuiBase *IntuitionBase;
  137.  
  138.   This is the only solution I can come up. Do YOU have a better one? Please
  139.   tell me YOUR opinion!
  140.  
  141.  
  142. To do:
  143. ~~~~~~
  144.   - Auto-play-option (This was what I intended first: a Minesweeper that
  145.     solves itself! Shouldn't be too difficult)
  146.   - Intuition-Menus + Requester for "Custon"-settings
  147.   - WB-Startup-Code & Command-Line-Parsing
  148.   - Highscore-List
  149.   - Plugging up that memory-leak
  150.  
  151.  
  152. Bug(s):
  153. ~~~~~~~
  154.   Each time you invoke the game, you loose some (fast) memory!
  155.   The amount ranges from 150 bytes to about 30 Kbytes! It would
  156.   be quite good for me to know where those bytes go. Read the
  157.   source and tell me why!
  158.  
  159.  
  160. Thanks to:
  161. ~~~~~~~~~~
  162.   - Markus Stipp (MSCalendar)         => various font-stuff
  163.   - Stuart Mitchell (Clock V1.4)      => timer.device-handling
  164.   - Alexandru-Aurel Balmosan (ALoad)  => Gadget-stuff
  165.   - Markus Wild                       => C++-Compiler ;-)
  166.  
  167.  
  168. Legal stuff:
  169. ~~~~~~~~~~~~
  170.   The Program "AMIGA Minesweeper V0.98" and it's Source are freely
  171.   distributably, although they remain (c)opyrighted 1992 by me. It's
  172.   OK to spread it on any PD-disks, as long as their charge doesn't
  173.   exceed 5,- DM or an equal amount in any other currency. It may be
  174.   copied and distributed via electronic networks suc has Internet
  175.   and it may also be put on anonymouse ftp-servers, BBS', ...
  176.   The program may not not be altered and redistributed in any way!
  177.   Please ask me first, also if you have some ideas!
  178.   Although the development of the game was sped up by consulting
  179.   various sources from other people (see "Thanks"), no code from any
  180.   other program is used.
  181.  
  182.  
  183. Author:      Hubert Feyrer    
  184. ~~~~~~~      Bachstr. 40      
  185.              W-8304 Mallersdorf 
  186.              Tel.: 08772 / 6084
  187.              Email: c9020@rrzc1.rz.uni-regensburg.de [132.199.40.1]
  188.  
  189.              >>>> ANY RESPONSE WELCOME! <<<<
  190.